# Shadow pagetable memory for the domain, in MB.
# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
-shadow_memory = 8
+# shadow_memory = 8
# A name for your domain. All domains must have different names.
name = "ExampleHVMDomain"
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
#-----------------------------------------------------------------------------
-# boot on floppy (a), hard disk (c) or CD-ROM (d)
+# boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d)
# default: hard disk, cd-rom, floppy
#boot="cda"
--- /dev/null
+
+This is an Etherboot option ROM for the rtl8139 NIC. It has a few
+non-standard settings, just to do with timeouts and when to give up.
+
+Rom-o-matic.net will provide this image at the following URL:
+
+http://rom-o-matic.net/5.4.2/build.php?version=5.4.2&F=ignore&nic=rtl8139%3Artl8139+--+%5B0x10ec%2C0x8139%5D&ofmt=Binary+ROM+Image%28.zrom%29&arch=i386&ASK_BOOT=-1&BOOT_FIRST=BOOT_NIC&BOOT_SECOND=BOOT_NOTHING&BOOT_THIRD=BOOT_NOTHING&BOOT_INDEX=0&STATIC_CLIENT_IP=&STATIC_SUBNET_MASK=&STATIC_SERVER_IP=&STATIC_GATEWAY_IP=&STATIC_BOOTFILE=&EXIT_ON_FILE_LOAD_ERROR=on&DHCP_CLIENT_ID=&DHCP_CLIENT_ID_LEN=&DHCP_CLIENT_ID_TYPE=&DHCP_USER_CLASS=&DHCP_USER_CLASS_LEN=&ALLOW_ONLY_ENCAPSULATED=on&DEFAULT_BOOTFILE=&CONGESTED=on&BACKOFF_LIMIT=7&TIMEOUT=180&TRY_FLOPPY_FIRST=0&EXIT_IF_NO_OFFER=on&TAGGED_IMAGE=on&ELF_IMAGE=on&PXE_IMAGE=on&DOWNLOAD_PROTO_TFTP=on&COMCONSOLE=0x3F8&CONSPEED=9600&COMPARM=0x03&PXE_EXPORT=on&CONFIG_PCI=on&CONFIG_ISA=on&BUILD_ID=&PCBIOS=on&A=Get+ROM
acpi/acpi.a:
$(MAKE) -C acpi
-roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin ../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../vmxassist/vmxassist.bin
+roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin ../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../vmxassist/vmxassist.bin ../etherboot/eb-rtl8139.zrom
sh ./mkhex rombios ../rombios/BIOS-bochs-latest > roms.h
sh ./mkhex vgabios_stdvga ../vgabios/VGABIOS-lgpl-latest.bin >> roms.h
sh ./mkhex vgabios_cirrusvga ../vgabios/VGABIOS-lgpl-latest.cirrus.bin >> roms.h
sh ./mkhex vmxassist ../vmxassist/vmxassist.bin >> roms.h
+ sh ./mkhex etherboot ../etherboot/eb-rtl8139.zrom >> roms.h
.PHONY: clean
clean:
/* memory map */
#define HYPERCALL_PHYSICAL_ADDRESS 0x00080000
#define VGABIOS_PHYSICAL_ADDRESS 0x000C0000
+#define ETHERBOOT_PHYSICAL_ADDRESS 0x000C8000
#define VMXASSIST_PHYSICAL_ADDRESS 0x000D0000
#define ROMBIOS_PHYSICAL_ADDRESS 0x000F0000
}
}
+static
+int must_load_nic(void)
+{
+ /* If the network card is in the boot order, load the Etherboot
+ * option ROM. Read the boot order bytes from CMOS and check
+ * if any of them are 0x4. */
+ uint8_t boot_order;
+
+ /* Read CMOS register 0x3d (boot choices 0 and 1) */
+ outb(0x70, 0x3d);
+ boot_order = inb(0x71);
+ if ( (boot_order & 0xf) == 0x4 || (boot_order & 0xf0) == 0x40 )
+ return 1;
+ /* Read CMOS register 0x38 (boot choice 2 and FDD test flag) */
+ outb(0x70, 0x38);
+ boot_order = inb(0x71);
+ if ( (boot_order & 0xf0) == 0x40 )
+ return 1;
+ return 0;
+}
+
int main(void)
{
int acpi_sz;
vgabios_stdvga, sizeof(vgabios_stdvga));
}
+ if ( must_load_nic() )
+ {
+ printf("Loading ETHERBOOT ...\n");
+ memcpy((void *)ETHERBOOT_PHYSICAL_ADDRESS,
+ etherboot, sizeof(etherboot));
+ }
+
if ( get_acpi_enabled() != 0 )
{
printf("Loading ACPI ...\n");